<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <base href="${pageContext.request.contextPath}/">
    <title>上传照片</title>
    <link rel="stylesheet" href="../static/bootstrap/css/bootstrap.min.css">
    <script type="text/javascript" src="../static/jquery/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="../static/bootstrap/js/bootstrap.min.js"></script>
    <script>
        $(function () {

        })
        function GetRequest() {
            const url = location.search;
            const theRequest = new Object();
            let strs;
            if (url.indexOf("?") != -1) {
                const str = url.substr(1);
                strs = str.split("&");
                for (let i = 0; i < strs.length; i++) {
                    theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
                }
            }
            return theRequest;
        }
        const cno = GetRequest().cno;
        alert(cno);
        $("#cno").read(function () {
            document.getElementById("cno").value = cno;
        })
    </script>
</head>
<body>
<div style="text-align: center">
    <h1>您还没有照片，请上传照片</h1>
    <form action="upload.do" method="post" enctype="multipart/form-data">
        <label for="cno"></label><input type="text" id="cno" name="cno">
        <p>请选择照片：<input type="file" name="file"></p>
        <p><button>上传</button></p>
        <button type="button"><a href="selectList.do">返回</a> </button>
    </form>
</div>
</body>
</html>
